var _JpxxButtonLength = 68;
var _JpxxButtonCharWidth = 15;
if(navigator.appName=="Microsoft Internet Explorer"){
    _JpxxButtonLength = 68;
    _JpxxButtonCharWidth = 15;
}
else{
    _JpxxButtonLength = 80;
    _JpxxButtonCharWidth = 20;
}

/**
 * ************************************************************************
 * Button
 * ************************************************************************
 */
var _Jpxx = function(){}

_Jpxx.button = function(img,str,url,type){
    var button_length   = (str.length)*_JpxxButtonCharWidth + 30;
    if(str.length==2)    {
        button_length = _JpxxButtonLength;
    }
    var button;

    if(type==0)    {
        button = "<button style=\"width:"+button_length+"px; height:30px;background-color:#FFFFFF; cursor:pointer; border:1px solid #FFFFFF;\" onClick=\"window.location.href='"+url+"'\" onMouseOver=\"this.style.backgroundColor= '#F0F0F0';this.style.border='1px solid #D4D0C8'\" onMouseOut=\"this.style.backgroundColor='#FFFFFF';this.style.border='1px solid #FFFFFF'\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"28\" height=\"28\" style=\"background-repeat:no-repeat;width:28px;height:28px;float:left;margin-left:2px;background-image:url("+img+");\">&nbsp;</td><td align=\"center\" style=\"font-size:12px;padding-top:1 1 1;\">"+str+"</td></tr></table></button>";
    }
    else if(type==1)    {
        button = "<button style=\"width:"+button_length+"px; height:30px;background-color:#FFFFFF; cursor:pointer; border:1px solid #FFFFFF;\" onClick=\""+url+"\" onMouseOver=\"this.style.backgroundColor= '#F0F0F0';this.style.border='1px solid #D4D0C8'\" onMouseOut=\"this.style.backgroundColor='#FFFFFF';this.style.border='1px solid #FFFFFF'\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"28\" height=\"28\" style=\"background-repeat:no-repeat;width:28px;height:28px;float:left;margin-left:2px;background-image:url("+img+");\">&nbsp;</td><td align=\"center\" style=\"font-size:12px;padding-top:1 1 1;\">"+str+"</td></tr></table></button>";
    }
    return button;
}

_Jpxx.getRefreshButton = function(){
    var refreshButton = "<button style=\"width:"+_JpxxButtonLength+"px; height:30px;background-color:#FFFFFF; cursor:pointer; border:1px solid #FFFFFF;\" onClick=\"window.location.reload();\" onMouseOver=\"this.style.backgroundColor= '#F0F0F0';this.style.border='1px solid #D4D0C8'\" onMouseOut=\"this.style.backgroundColor='#FFFFFF';this.style.border='1px solid #FFFFFF'\"><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=\"28\" height=\"28\" style=\"background-repeat:no-repeat;width:28px;height:28px;float:left;margin-left:2px;background-image:url(images/manageMenu/refresh.gif);\">&nbsp;</td><td align=\"center\" style=\"font-size:12px;padding-top:1 1 1;\">刷新</td></tr></table></button>";
    return refreshButton;
}

/**
 * ************************************************************************
 * Button End
 * ************************************************************************
 */